<?php

namespace app\command;

use Workerman\Worker;
use think\console\Input;
use think\console\Output;
use think\console\Command;
use GatewayWorker\BusinessWorker;
use app\command\Events;

class BusinessWork extends Command
{
    protected function configure()
    {
        $this->setName('business')->setDescription('businessworker start');
    }

    protected function execute(Input $input, Output $output)
    {
        $worker = new BusinessWorker();
        $worker->name = 'businessworker';
        $worker->count = 1;
        $worker->registerAddress = '127.0.0.1:' . config('extra.socket.register_port');
        $worker->eventHandler    = Events::class;
        Worker::runAll();
    }
}
